<template>
  <div id="index">
    <div class="bg"></div>
    <div class="sarch">
      <div><img src="/static/img/yaoqing.png"/>邀请</div>
      <van-search placeholder="搜索喜欢的商品" v-model="value" @search="onSearch" />
      <div><img src="/static/img/xinxi.png"/></div>
    </div>
    <van-tabs v-model="active">
      <van-tab title="综合"></van-tab>
      <van-tab title="新品"></van-tab>
      <van-tab title="推荐"></van-tab>
      <van-tab title="精品"></van-tab>
    </van-tabs>
    <van-swipe :autoplay="3000">
      <van-swipe-item><img src="/static/img/banner@3x.png"/></van-swipe-item>
      <van-swipe-item><img src="/static/img/banner@3x.png"/></van-swipe-item>
      <van-swipe-item><img src="/static/img/banner@3x.png"/></van-swipe-item>
      <van-swipe-item><img src="/static/img/banner@3x.png"/></van-swipe-item>
    </van-swipe>
    <div class="nav">
      <van-row> 
        <van-col span="8"><img src="/static/img/icon_tm@3x.png" alt="" class="nav-ico">天猫特惠</van-col>
        <van-col span="8"><img src="/static/img/icon_9.9@3x.png" alt="" class="nav-ico">9.9</van-col>
        <van-col span="8"><img src="/static/img/icon_xld@3x.png" alt="" class="nav-ico">销量单</van-col>
        <van-col span="8"><img src="/static/img/icon_xld@3x.png" alt="" class="nav-ico">销量单</van-col>
        <van-col span="8"><img src="/static/img/icon_xld@3x.png" alt="" class="nav-ico">销量单</van-col>
        <van-col span="8"><img src="/static/img/icon_xld@3x.png" alt="" class="nav-ico">销量单</van-col>
        <van-col span="8"><img src="/static/img/icon_xld@3x.png" alt="" class="nav-ico">销量单</van-col>
        <van-col span="8"><img src="/static/img/icon_xld@3x.png" alt="" class="nav-ico">销量单</van-col>
        <van-col span="8"><img src="/static/img/icon_xld@3x.png" alt="" class="nav-ico">销量单</van-col>
        <van-col span="8"><img src="/static/img/icon_xld@3x.png" alt="" class="nav-ico">销量单</van-col>
      </van-row>
    </div>
    <div class="fl"><img src="/static/img/fuli.png" /></div>
    <div class="pdjx">
      <div><img src="/static/img/pdjx.png"/></div>
      <div class="jx">
        <div><span>聚划算拼团</span><img src="/static/img/goods.png"/></div>
        <div>
          <div><span>今日上新</span><img src="/static/img/goods.png"/></div>
          <div><span>热销榜单</span><img src="/static/img/goods.png"/></div>
          <div><span>母婴产品</span><img src="/static/img/goods.png"/></div>
          <div><span>潮流范儿</span><img src="/static/img/goods.png"/></div>
        </div>
      </div>
    </div>
    <div class="jrtj">
      <span>今日推荐</span>
      <div class="sp">
        <div class="sp1">
          <div class="jrtj_box">
            <img src="/static/img/jrtj.png"/>
            <span>客户推荐</span>
            <div>
              <span>￥79.9</span>
              <del>￥14.00</del>
            </div>
          </div>
          <div class="jrtj_box">
            <img src="/static/img/jrtj.png"/>
            <span>客户推荐</span>
            <div>
              <span>￥79.9</span>
              <del>￥14.00</del>
            </div>
          </div>
          <div class="jrtj_box">
            <img src="/static/img/jrtj.png"/>
            <span>客户推荐</span>
            <div>
              <span>￥79.9</span>
              <del>￥14.00</del>
            </div>
          </div>
          <div class="jrtj_box">
            <img src="/static/img/jrtj.png"/>
            <span>客户推荐</span>
            <div>
              <span>￥79.9</span>
              <del>￥14.00</del>
            </div>
          </div>
          <div class="jrtj_box">
            <img src="/static/img/jrtj.png"/>
            <span>客户推荐</span>
            <div>
              <span>￥79.9</span>
              <del>￥14.00</del>
            </div>
          </div>
          <div class="jrtj_box">
            <img src="/static/img/jrtj.png"/>
            <span>客户推荐</span>
            <div>
              <span>￥79.9</span>
              <del>￥14.00</del>
            </div>
          </div>
          <div class="jrtj_box">
            <img src="/static/img/jrtj.png"/>
            <span>客户推荐</span>
            <div>
              <span>￥79.9</span>
              <del>￥14.00</del>
            </div>
          </div>
          <div class="jrtj_box">
            <img src="/static/img/jrtj.png"/>
            <span>客户推荐</span>
            <div>
              <span>￥79.9</span>
              <del>￥14.00</del>
            </div>
          </div>
        </div>
      </div>
    </div>
    <div class="hjzb">
      <img src="/static/img/heng.png"/>
      <span>好券直播</span>
    </div>
    <div class="list">
      <div @click="$router.push({path:'/goods'})" class="good-list">
        <img src="/static/img/good.png"/>
        <div>
          <span>韩都衣舍2018秋装新款</span>
          <div><span>￥79.9</span><span>原价 <del>￥17.90</del></span></div>
          <div class="lq">
            <div><img src="/static/img/lq.png"/><span>领券  7元</span></div>
            <span>已售5.1万</span>
          </div>
          <div class="yg">
            <div>预估赚￥5.20</div>
            <div>升级赚￥5.20</div>
          </div>
        </div>
      </div>
      <div class="good-list">
        <img src="/static/img/good.png"/>
        <div>
          <span>韩都衣舍2018秋装新款</span>
          <div><span>￥79.9</span><span>原价 <del>￥17.90</del></span></div>
          <div class="lq">
            <div><img src="/static/img/lq.png"/><span>领券  7元</span></div>
            <span>已售5.1万</span>
          </div>
          <div class="yg">
            <div>预估赚￥5.20</div>
            <div>升级赚￥5.20</div>
          </div>
        </div>
      </div>
    </div>


  </div>
</template>
<script>
  export default {
    name: "index",
    data() {
      return {
        value: '',
        active: 0,
        loading: false,
        finished: false,
        recommendShop:[],
      };
    },
    methods: {
      onSearch() {
        var $this=this;

      },
      onSelect(item) {
        // 点击选项时默认不会关闭菜单，可以手动关闭
        this.show = false;
      },
      selectRecommend(){
        var params = new URLSearchParams();
        params.append('pageSize', '3');       //你要传给后台的参数值 key/value
        params.append('pageNum', '1');
        this.$POST('/commodity/selectRecommend',params).then(res =>{
          // console.log(res.data)
          this.recommendShop=res.data;
          console.log(this.recommendShop);
        }).catch(res=>{
          console.log("获取数据失败!")
        })
      }
    },
    created(){
      // this.selectRecommend();
    },
  }
</script>

<style scoped>
  .count{
    width: 100%;
    float: left;
    margin-bottom:10px;
  }
  .count>div{
    width: 100%;
    background: #ffffff;
    padding-top:10px;
    float: left;
  }
  .count>div>p{
    text-align:left;
    margin: 0;
    margin-left: 2%;
    margin-bottom:10px;
    padding-left: 10px;
    border-left: 3px solid #fe513f;
    color: #fe513f;
  }
  .sarch{
    position: relative;

  }
  .sarch>div:first-child{
    position: absolute;
    left:13px;
    top: 10px;
    font-size: 12px;
  }
  .sarch>div:first-child>img{
    display: block;
    width: 15px;
    margin: 0 auto;
  }
  .sarch>div:last-child{
    position: absolute;
    right: 15px;
    top: 11px;
  }
  .sarch>div:last-child>img{
      display: block;
      width:30px;
  }
  .fl{
    width:95%;
    margin: 0 auto;
  }
  .fl>img{
    display: block;
    width: 100%;
  }
  .pdjx{
    width:95%;
    margin: 0 auto;
  }
  .pdjx>div{
    width:32%;
    margin: 0 auto;
    margin-top: 15px;
    margin-bottom: 15px;
  }
  .pdjx>div>img{
    display: block;
    width: 100%;
  }
  .details{
    background: #eeeeee;
    width:49%;
    float: left;
    margin-left:0.5%;
    margin-top:6px;
  }
  .details>div{
    width:100%;
    display: inline-block;
  }
  .details>div>img{
    display: block;
    width: 100%;
    border-top-left-radius:10px;
    border-top-right-radius:10px;
  }
  .details>div:last-child{
    background: #ffffff;
    position: relative;
    top: -5px;
    text-align: left;
    border-bottom-left-radius:10px;
    border-bottom-right-radius:10px;
    padding-bottom:5px;
  }
  .details>div:last-child>span{
    display: block;
    width: 95%;
    margin: 0 auto;
    font-size: 16px;
  }
  .details>div:last-child>div{
    margin-top: 15px;
  }
  .details>div:last-child>div>span:first-child{
    font-size: 22px;
    color: #fe513f;
  }
  .details>div:last-child>div>span:nth-child(2){
    font-size:14px;
    color: #959595;
    margin-left: 3px;
  }
  .details>div:last-child>div>span:last-child{
    font-size:14px;
    color: #fe513f;
    display: inline-block;
    padding: 1px 3px;
    border: 1px solid #fe513f;
    border-radius:10px;
    position: relative;
    right:4px;
    top: 3px;
    float: right;
  }
  .nav-ico{
    display: block;
    width:50%;
    margin: 0 auto;
  }
  .nav{
    padding-bottom: 15px;
    margin-top:6px;
    font-weight: bold;
    position: relative;
    line-height: 30px;
  }
  .tj{
    width: 100%;
    height: 50px;
    background: #ffffff;
    float: left;
  }
  .tj>div{
    width:35%;
    border: 1px solid #fe513f;
    margin: 0 auto;
    position: relative;
    top: 25px;
  }
  .tj>div>img{
    display:block;
    height: 18px;
    position: absolute;
    left: 0;
    right: 0;
    margin: auto;
    top: -9px;
  }
  .jx{
    width: 100%!important;
    height:200px;
    font-family: 黑体;
    font-size: 18px;
    line-height:40px;
  }
  .jx>div>span{
    position: relative;
    top: 10px;
  }
  .jx>div>img{
    display: block;
    width: 80%;
    margin: 0 auto;
  }
  .jx>div{
    float: left;
    width: 50%;
    height: 100%;
  }
  .jx>div:first-child{
    background:#ffe7f7;
  }
  .jx>div>div{
    width: 50%;
    height: 50%;
    float: left;
    font-size: 14px;
    line-height: 30px;
  }
  .jx>div>div>img{
    display: block;
    width: 80%;
    margin: 0 auto;
  }
  .jx>div>div:first-child{
    background: #fff3e7;
  }
  .jx>div>div:nth-child(2){
    background: #ffe7f7;
  }
  .jx>div>div:nth-child(3){
    background: #efe3f7;
  }
  .jx>div>div:nth-child(4){
    background: #fff3e7;
  }
  /*.swipeBox{*/
    /*width: 100%;*/
  /*}*/
  /*.swipeItem{*/
    /*width: 25%;*/
  /*}*/
  .jrtj{
    text-align: left;
    width: 95%;
    height:180px;
    margin: 0 auto;

  }
  .sp{
    width: 100%;
    overflow-x: scroll;
    overflow-y: hidden;
  }
  .sp1{
    width:655px;
    height:140px;
    display: flex;
    justify-content: space-around;
  }
  .jrtj>span{
    display: block;
    float: left;
    width: 100%;
    margin-bottom: 10px;
  }
  .jrtj .jrtj_box{
    position: relative;

  }
  .jrtj .jrtj_box img{
    width: 95%;
    margin: 0 auto;
  }
  .jrtj_box>div>span{
    text-align: center;
    display: block;
  }
  .jrtj_box>div>div>span{
    float: left;
    font-size:15px;
    color: #e12532;
  }
  .jrtj_box>div>div>del{
    position: absolute;
    right: 5px;
    bottom:2px;
    font-size: 12px;
    color: #a8a9a9;
  }


  .hjzb{
    width: 40%;
    margin: 0 auto;
    margin-bottom: 10px;
    position: relative;
    color: #e12532;
  }
  .hjzb>img{
    display: block;
    position: absolute;
    z-index: 0;
    width: 100%;
    top: 0;
    bottom: 0;
    margin: auto;
  }
  .good-list{
    width: 95%;
    text-align: left;
    margin: 0 auto;
    margin-bottom: 10px;
  }
  .good-list:after{
    clear:both;
    content:'';
    display:block;
    width:0;
    height:0;
    visibility:hidden;
  }
  .list:after{
    clear:both;
    content:'';
    display:block;
    width:0;
    height:0;
    visibility:hidden;
  }
  .good-list>img{
    float: left;
    width: 50%;
  }
  .good-list>div{
    width: 48%;
    float: left;
    text-align:left;
    margin-left:2%;
  }
  .good-list>div>span{
    font-family: 黑体;
    font-size: 18px;
    font-weight: bold;
  }
  .good-list>div>div>span:first-child {
    font-size: 20px;
    color:#e12532;
  }
  .good-list>div>div>span:last-child{
    font-size: 13px;
    float:right;
    line-height: 26px;
    color: #a8a9a9;
  }
  .good-list>div>div{
  margin-top: 15px;
  }
  .good-list>div>div:after{
    content:"";
    display:block;
    height:0;
    clear:both;
    visibility:hidden;
  }
  .lq{
    width: 100%;
  }
  .lq:after{
    clear:both;
    content:'';
    display:block;
    width:0;
    height:0;
    visibility:hidden;
  }
  .lq>div{
    width: 40%;
    position: relative;
  }
  .lq>div:first-child{
    float: left;
    height:30px;
  }
  .lq>div>img{
    position: absolute;
    top: 0;
    left: 0;
    z-index: 0;
    display: block;
    width: 100%;
  }
  .lq>div>span{
    z-index: 1;
    text-align: right;
    line-height:25px;
    position: absolute;
    right:5px;
    color: #ffffff;
    font-size: 14px;
  }
  .yg{
    width: 100%;
    font-size: 12px;
  }
  .yg>div:first-child{
    float: left;
    padding: 2px 5px;
    background: #ffdcdc;
    color: #e12532;
    border-radius:7px;
  }
  .yg>div:last-child{
    float: right;
    padding: 2px 5px;
    background: linear-gradient(to right,#ff722d, #ff4b26 , #ff2820); /* 标准的语法 */
    border-radius:7px;
    color: #ffffff;
  }
  body{
    background: #ffff;
  }
  #index .van-search{
      width: 80%;
    margin: 0 auto;
    background: #ffffff!important;
  }
  #index .van-search .van-cell{
    border-radius: 25px;
    background: #f7f7f7;
    padding:3px 10px;
  }
  #index .van-swipe{
    width: 100%;
  }
  #index .van-swipe-item>img{
    display: block;
    width: 100%;
    height: 100%;
  }
  #index .van-col--8{
    width: 20%!important;
    margin-top:10px;
  }
</style>
